import { defHttp } from "@/utils/http";

// ERP 资产维修情况 VO
export interface PropertyMtnstatesVO {
	id: number; // ID
	parentId: number; // 父级ID
	name: string; // 资产类型名称/描述
	sqNumb: number; // 资产类型顺序
	status: string; // 状态
}

// ERP 资产维修情况 API
export const PropertyMtnstatesApi = {
	// 查询资产维修情况分页
	getPropertyMtnstatesPage: async (params: any) => {
		return await defHttp.get({ url: `/whs/asm-mtnstates/page`, params });
	},

	// 查询资产维修情况详情
	getPropertyMtnstates: async (id: number) => {
		return await defHttp.get({ url: `/whs/asm-mtnstates/get?id=` + id });
	},

	// 新增资产维修情况
	createPropertyMtnstates: async (data: PropertyMtnstatesVO) => {
		return await defHttp.post({ url: `/whs/asm-mtnstates/create`, data });
	},

	// 修改资产维修情况
	updatePropertyMtnstates: async (data: PropertyMtnstatesVO) => {
		return await defHttp.put({ url: `/whs/asm-mtnstates/update`, data });
	},

	// 删除资产维修情况
	deletePropertyMtnstates: async (id: number) => {
		return await defHttp.delete({
			url: `/whs/asm-mtnstates/delete?id=` + id
		});
	},

	// 导出资产维修情况 Excel
	exportPropertyMtnstates: async (params: any) => {
		return await defHttp.download({ url: `/whs/asm-mtnstates/export-excel`, params });
	}
};
